package com.lk.service;

import com.lk.entity.User;
import org.apache.ibatis.session.SqlSession;



public class UserServiceImpl implements UserService{

    SqlSession session= SqlSessionFactoryUtil.getSqlSession();
    UserDao userDao=session.getMapper(UserDao.class);

    @Override
    public User userLogin(User user) {
        return userDao.userLogin(user);
    }

    @Override
    public List<User> selectAll() {
        return  userDao.selectUserAll();
    }
    public List<User> selectById(int userId){
        return  userDao.getUserById(userId);
    }

    @Override
    public int addUser(User user) {
        return userDao.userAdd(user);
    }

    @Override
    public int deleteUser(int userId) {
        return userDao.userDel(userId);
    }
}
